package com.atguigu.gmall.feign.order;

import com.atguigu.gmall.model.order.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/api/order")
@FeignClient("service-order")
public interface OrderFeignClient {
    @GetMapping("/getorder/{id}")
    OrderInfo getOrderById(@PathVariable("id") Long orderId);

    @GetMapping("/payed/success")
    String changeOrderStatusPayed(@RequestParam("outTradeNo") String outTradeNo);

    @GetMapping("/orderinfo/details/{outTradeNo}")
    OrderInfo getOrderInfoWithDetailsByOutTradeNo(@PathVariable("outTradeNo") String outTradeNo);

    @PostMapping("/seckill/submit/order")
    OrderInfo submitSeckillOrder(@RequestBody OrderInfo orderInfo);
}
